package com.linhh.mall.center.common.pojo;

import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import javax.persistence.Column;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.List;

/**
 * category_info 类别信息实体类
 * @Author linhh
 * @Date 2022 10 27 00 23
 **/
@Data
@AllArgsConstructor
@NoArgsConstructor
@Accessors(chain = true)
@Table(name = "category_info")
public class CategoryInfo extends BaseEntity implements Serializable {
    /**
     * 分类名称
     */
    @Column(name = "category_name", nullable = false, length = 64)
    private String categoryName;

    /**
     * 父级ID
     */
    @Column(name = "parent_id", nullable = false, length = 20)
    private Long parentId;

    /**
     * 层级
     */
    @Column(name = "level", nullable = false, length = 11)
    private Integer level;

    /**
     * 排序
     */
    @Column(name = "sort", length = 11)
    private Integer sort;

    /**
     * 状态
     */
    @Column(name = "status", nullable = false, length = 4)
    private Byte status;

    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    private List<CategoryInfo> children;

    public String getCategoryName() {
        return categoryName;
    }

    public void setCategoryName(String categoryName) {
        this.categoryName = categoryName;
    }

    public Long getParentId() {
        return parentId;
    }

    public void setParentId(Long parentId) {
        this.parentId = parentId;
    }

    public Integer getLevel() {
        return level;
    }

    public void setLevel(Integer level) {
        this.level = level;
    }

    public Integer getSort() {
        return sort;
    }

    public void setSort(Integer sort) {
        this.sort = sort;
    }

    public Byte getStatus() {
        return status;
    }

    public void setStatus(Byte status) {
        this.status = status;
    }

    public List<CategoryInfo> getChildren() {
        return children;
    }

    public void setChildren(List<CategoryInfo> children) {
        this.children = children;
    }
}
